package com.dfcj.oauth2security.service;

import com.dfcj.oauth2security.dao.AccountUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

@Service
public class MyDetailService implements UserDetailsService {
    @Autowired
    private AccountUserMapper accountUserMapper;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException{
        System.out.println("username:"+username);
        return accountUserMapper.selectByPrimaryKey("1");
    }
}
